<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html>
	<head>
		<title>开奖大厅</title>
		<%@include file="/WEB-INF/base.jspf"%>
		<link rel="stylesheet" href="/css/style.css" />
		<style>
			#cai *{font-size: 16px;text-align: left;}
			#cai li{border-bottom: 1px solid silver;height: 80px;}
			#cai img{height: 60px;margin-top: 10px;}
			#cai div{margin-top: -60px;margin-left: 70px;}
			#cai .name{font-weight: bold;}
			#cai .lottertime{font-size: 14px;float: right;}
			#cai .period{font-size: 14px;}
			#cai .lotternumber{color: red;font-weight: bold;}
			
			.shaizi{
				display:block;
				float:left;
				margin-right:10px;
				width: 0.56rem;
    			height: 0.56rem;
    			margin-top: 3px;
			}
			
			.sz1{
			 	background: url(/img/shaizi/dice1.png) 50% no-repeat; 
				background-size: contain;
			}
			.sz2{
				background: url(/img/shaizi/dice2.png) 50% no-repeat;
				background-size: contain;
			}
			.sz3{
				background: url(/img/shaizi/dice3.png) 50% no-repeat;
				background-size: contain;
			}
			.sz4{
				background: url(/img/shaizi/dice4.png) 50% no-repeat;
				background-size: contain;
			}
			.sz5{
				background: url(/img/shaizi/dice5.png) 50% no-repeat;
				background-size: contain;
			}
			.sz6{
				background: url(/img/shaizi/dice6.png) 50% no-repeat;
				background-size: contain;
			}
		</style>
	</head>
	<body>
		<div class="bg-theme col-xs-12 col-sm-4 col-sm-offset-4 text-center top">
			<span>开奖大厅</span>
		</div>
		<div id="cai" class="col-xs-12 col-sm-4 col-sm-offset-4 text-center body cai2" style="padding: 50px 10px;">
		</div>
		<div class="col-xs-12 col-sm-4 col-sm-offset-4 text-center foot">
			<iframe src="f.jsp"></iframe>
		</div>
	</body>
	<script>
		$(function(){
			$(".nav1 select").change(function(){
				var cla=$(".nav1 select").val();
				$(".cz").addClass("hidden");
				$("."+cla).removeClass("hidden");
			});
			$("#cai").html("");
			ajax({
				url:'/lotter/getlotters.do',
				type:'post',
				success:function(data){
					var json=eval('('+data+')');
					if(json.state==1){
						data=json.data;
						for(var i=0;i<data.length;i++){
							$("#cai").append("<li class='"+data[i].classt+"' href='/lotter/lot.do?zl="+data[i].cname+"'>"
								+ "<img src='img/caizhong/"+data[i].img+".png' />"
								+ "<div><span class='name'>"+data[i].name+"</span><br>"
								+ "<span class='lottertime'>"+data[i].lottertime+"</span>"
								+ "<span class='period'>第"+data[i].period+"期</span><br>"
								+ "<span class='lotternumber'>"+data[i].lotternumber+"</span>"
								+ "</div></li>");
						}
						$("#cai li").click(function(){
							window.location.href=$(this).attr("href");
						});
					}else{
						alert("获取数据失败");
					}
				}
			});
		});
		window.onload=function () {
			
		    document.addEventListener('touchstart',function (event) {
		        if(event.touches.length>1){
		            event.preventDefault();
		        }
		    })
		    var lastTouchEnd=0;
		    document.addEventListener('touchend',function (event) {
		        var now=(new Date()).getTime();
		        if(now-lastTouchEnd<=300){
		            event.preventDefault();
		        }
		        lastTouchEnd=now;
		    },false)
		}	
	</script>
</html>
